// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import 'bootstrap3/dist/css/bootstrap.min.css'
import 'bootstrap3/dist/js/bootstrap.min.js'
import './assets/fonts/iconfont.css'
import Moment from 'moment'
// 导入axios
import axios from 'axios'
// 挂载到原型对象
Vue.prototype.$http = axios
    //配置请求根路径
axios.defaults.baseURL = 'http://timemeetyou.com:8889/api/private/v1/'
    //请求拦截器
axios.interceptors.request.use(config => {
        config.headers.Authorization = window.sessionStorage.getItem('token')
        console.log(config)
        return config
    })
    //过滤器
Vue.filter('dataFormat', time => {
    return Moment.unix(time).format('YYYY-MM-DD HH:mm:ss')
})
Vue.config.productionTip = false
Vue.use(ElementUI);
//导入全局样式表
import "./assets/css/global.css"
new Vue({
    el: '#app',
    router,
    components: { App },
    template: '<App/>'
})